﻿using System;
using System.Data;
using System.Runtime.Serialization;
using System.ServiceModel;

namespace HRMService
{
    // NOTE: If you change the interface name "ICertificate" here, you must also update the reference to "ICertificate" in App.config.
    [ServiceContract(Namespace = "http://HRMService")]
    public interface ILeaveWork
    {
        [OperationContract]
        DataSet LeaveWork_GetAll();

        [OperationContract]
        bool LeaveWork_CheckExistEmployee(int EmployeeID, int month, int year);

        [OperationContract]
        LeaveWorkInfo LeaveWork_GetInfo(int FMID);

        [OperationContract]
        int LeaveWork_CountDay(int EmployeeID, int LeaveID);

        [OperationContract]
        DataSet LeaveWork_GetList(out int ItemCount, int currentPage, int pageSize, int year, int BranchID, int DepartmentID, string keyWord);

        [OperationContract]
        DataSet LeaveWork_Report(int BranchID, int DepartmentID, int month, int year);

        [OperationContract]
        DataSet LeaveWork_GetWithEmployee(int EmployeeID, DateTime _Date);

        [OperationContract]
        LeaveWorkInfo LeaveWork_GetInfoEmployee(int EmployeeID);

        [OperationContract]
        DataSet LeaveWork_GetAllWithDepartment(int DepartmentID);

        [OperationContract]
        int LeaveWork_Insert(LeaveWorkInfo eInfo);

        [OperationContract]
        bool LeaveWork_Update(LeaveWorkInfo eInfo);
                
        [OperationContract]
        bool LeaveWork_Delete(int LWID);

        [OperationContract]
        DataSet LeaveWork_GetListWithEmployee(int EmployeeID, int _year);

        [OperationContract]
        DataSet LeaveWork_GetDayUsed(int EmployeeID, int LeaveID);
        [OperationContract]
        DataSet LeaveWork_GetMarkWork(int Month, int Year, int BranchID, int _DepartmentID);
        [OperationContract]
        DataSet LeaveWork_GetTotalMarkWork(int Month, int Year, int BranchID, int _DepartmentID);
    }

    [DataContract(Namespace = "http://HRMService")]
    public class LeaveWorkInfo
    {
        int _ID;
        [DataMember]
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }

        int _EmployeeID;
        [DataMember]
        public int EmployeeID
        {
            get { return _EmployeeID; }
            set { _EmployeeID = value; }
        }

        int _BranchID;
        [DataMember]
        public int BranchID
        {
            get { return _BranchID; }
            set { _BranchID = value; }
        }

        int _DepartmentID;
        [DataMember]
        public int DepartmentID
        {
            get { return _DepartmentID; }
            set { _DepartmentID = value; }
        }

        int _LeaveID;
        [DataMember]
        public int LeaveID
        {
            get { return _LeaveID; }
            set { _LeaveID = value; }
        }

        DateTime _FromDate;
        [DataMember]
        public DateTime FromDate
        {
            get { return _FromDate; }
            set { _FromDate = value; }
        }

        DateTime _ToDate;
        [DataMember]
        public DateTime ToDate
        {
            get { return _ToDate; }
            set { _ToDate = value; }
        }

        string _Reason;
        [DataMember]
        public string Reason
        {
            get { return _Reason; }
            set { _Reason = value; }
        }

        decimal _TotalDays;
        [DataMember]
        public decimal TotalDays
        {
            get { return _TotalDays; }
            set { _TotalDays = value; }
        }

        
    }
}

